package itbour.onetouchshow.activity.video.videobg;

import android.os.Bundle;
import android.view.View;
import android.view.WindowManager;
import android.widget.RelativeLayout;

import butterknife.BindView;
import itbour.onetouchshow.R;
import itbour.onetouchshow.activity.version1_2.CommoninchingVideoBgActivity;
import itbour.onetouchshow.base.IntentCode;
import itbour.onetouchshow.bean.LoadVideoUserDocBg;
import itbour.onetouchshow.constants.AppConst;
import itbour.onetouchshow.constants.platform.WorkPlatform;
import itbour.onetouchshow.utils.L_;


public class VideobgDialgActivity extends VideobgActivity {


    @BindView(R.id.ry_title)
    RelativeLayout ryTitle;

    @Override
    protected int getLayoutId() {
        return R.layout.view_popup_bg_select;
    }


    @Override
    protected void initTitle() {
        super.initTitle();
        ryTitle.setVisibility(View.GONE);
        getToolBarView().getLeftimageView().setVisibility(View.VISIBLE);
        getToolBarView().getLeftimageView().setImageResource(R.mipmap.cancle_icon);
        getToolBarView().getLeftimageView().setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                onBackPressed();
            }
        });
        setTitleText("选择边框");

    }

    @Override
    protected void afterCreate(Bundle savedInstanceState) {
        getWindow().addFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN); //隐藏状态栏
        super.afterCreate(savedInstanceState);

    }


    @Override
    public void finish() {
        super.finish();
        overridePendingTransition(0, 0);
    }

    @Override
    protected void onChangeBg(LoadVideoUserDocBg.ListBean listBean) {
        int bgId = listBean.getId();
        L_.e(listBean.getId() + "作品ID");
        Bundle bundle = new Bundle();
        bundle.putInt(IntentCode.INCHING_TYPE, IntentCode.SUB_TYPE_PRODUCE);
        bundle.putInt(IntentCode.TAG, IntentCode.INTENT_VERTICAL_VIDEP);
        bundle.putInt(AppConst.BGID, Integer.valueOf(bgId));
        bundle.putString(AppConst.DOCID, mDocId);
        bundle.putString(WorkPlatform.TYPE, WorkPlatform.MOUDLE);
        openActivity(CommoninchingVideoBgActivity.class, bundle);
        finish();
    }

}
